{% extends 'PHPDishWebBundle::layout.html.twig' %}

{% block title %}{{ 'ui.register'|trans }}{% endblock %}

{% block script %}
    <script type="text/javascript" src="{{ asset('build/js/sign.js') }}"></script>
{% endblock %}

{% form_theme form 'PHPDishWebBundle:Form:captcha.html.twig' %}

{% block content %}
<div class="container">
    <div class="row">
        <div class="col-md-6 col-md-offset-3 col-sm-8 col-sm-offset-2">
            {{ form_start(form, {'method': 'post', 'action': path('fos_user_registration_register'), 'attr':{'class': 'reg-page', 'id': 'register-form'}}) }}
                <div class="reg-header">
                    <h2>{{ 'register.new'|trans }}</h2>
                    <p>{{ 'register.click_and_login'|trans({'%link%': path('login')})|raw }}</p>
                </div>
                {{ form_errors(form) }}
                {% from 'PHPDishWebBundle:Macros:notification.html.twig' import flashes %}
                {{ flashes() }}
                <div class="group">
                    <div class="input-group">
                        <span class="input-group-addon"><i class="if i-user"></i></span>
                        {{ form_widget(form.username, {'attr': {'class': 'form-control', 'placeholder': 'register.form.username'|trans}})  }}
                    </div>
                    {{ form_errors(form.username) }}
                </div>
                <div class="group">
                    <div class="input-group">
                        <span class="input-group-addon"><i class="if i-email"></i></span>
                        {{ form_widget(form.email, {'attr': {'class': 'form-control', 'placeholder':  'register.form.email'|trans}})  }}
                    </div>
                    {{ form_errors(form.email) }}
                </div>
                <div class="group">
                    <div class="input-group">
                        <span class="input-group-addon"><i class="if i-password"></i></span>
                        {{ form_widget(form.plainPassword.first, {'attr': {'class': 'form-control', 'placeholder':  'register.form.password'|trans}})  }}
                    </div>
                    {{ form_errors(form.plainPassword.first) }}
                </div>
                <div class="group">
                    <div class="input-group">
                        <span class="input-group-addon"><i class="if i-password"></i></span>
                        {{ form_widget(form.plainPassword.second, {'attr': {'class': 'form-control', 'placeholder': 'register.form.repeat_password'|trans}})  }}
                    </div>
                    {{ form_errors(form.plainPassword.second) }}
                </div>
                {{ form_widget(form.captcha) }}
                <div class="row">
                    <div class="col-lg-12 text-center">
                        <button class="btn btn-block u-btn-primary" type="submit">{{ 'ui.register'|trans }}</button>
                    </div>
                </div>
            {{ form_end(form) }}
        </div>
    </div>
</div>
{% endblock %}